﻿/************************************************************************

   Extended Silverlight Toolkit

   Copyright (C) 2010-2012 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://extendedsilverlight.codeplex.com/license

   Please purchase a commercial version of this toolkit if you are using
   it in a commercial product. The commercial versions support the project,
   and also include more features for each control, priority support,
   source code, updates, removed watermark, and a proprietary license.

   Visit http://xceed.com and follow @datagrid on Twitter.

  **********************************************************************/

using System;
using System.Diagnostics;

namespace Xceed.Silverlight.Data
{
  [DebuggerDisplay( "ExpSkip={ExpectedSkipCount}, ExpPeek={ExpectedPeekCount}, SourcePos={SourcePosition}" )]
  internal struct PeekParameters
  {
    #region Constructors

    internal PeekParameters(
      SourcePosition sourcePosition,
      long expectedSkipCount,
      int expectedPeekCount )
      : this( sourcePosition, expectedSkipCount, expectedPeekCount, null )
    {
    }

    internal PeekParameters(
      SourcePosition sourcePosition,
      long expectedSkipCount,
      int expectedPeekCount,
      bool approximateSkip )
      : this( sourcePosition, expectedSkipCount, expectedPeekCount, approximateSkip, null )
    {
    }

    internal PeekParameters(
      SourcePosition sourcePosition,
      long expectedSkipCount,
      int expectedPeekCount,
      DataSourceContext context )
      : this( sourcePosition, expectedSkipCount, expectedPeekCount, false, context )
    {
    }

    internal PeekParameters(
      SourcePosition sourcePosition,
      long expectedSkipCount,
      int expectedPeekCount,
      bool approximateSkip,
      DataSourceContext context )
    {
      if( sourcePosition == null )
        throw new ArgumentNullException( "sourcePosition" );

      m_sourcePosition = sourcePosition;
      m_expectedSkipCount = expectedSkipCount;
      m_expectedPeekCount = expectedPeekCount;
      m_approximateSkip = approximateSkip;
      m_context = context;
    }

    #endregion

    #region SourcePosition Property

    internal SourcePosition SourcePosition
    {
      get
      {
        return m_sourcePosition;
      }
    }

    private readonly SourcePosition m_sourcePosition;

    #endregion

    #region ExpectedSkipCount Property

    internal long ExpectedSkipCount
    {
      get
      {
        return m_expectedSkipCount;
      }
    }

    private readonly long m_expectedSkipCount;

    #endregion

    #region ExpectedPeekCount Property

    internal int ExpectedPeekCount
    {
      get
      {
        return m_expectedPeekCount;
      }
    }

    private readonly int m_expectedPeekCount;

    #endregion

    #region ApproximateSkip Property

    internal bool ApproximateSkip
    {
      get
      {
        return m_approximateSkip;
      }
    }

    private readonly bool m_approximateSkip;

    #endregion

    #region Context Property

    internal DataSourceContext Context
    {
      get
      {
        return m_context;
      }
    }

    private readonly DataSourceContext m_context;

    #endregion
  }
}
